Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Functions
Accessing and Changing Control Settings and Data /


SetControlData

NEW WITH THE APPEARANCE MANAGER

Sets control-specific data.

pascal OSErr SetControlData (
                     ControlHandle inControl,
                     ControlPartCode inPart,
                     ResType inTagName,
                     Size inSize,
                     Ptr inData);
inControl
On input, a handle to the control.
inPart
The part code of the control part whose control-specific data you wish to set; see "Control Part Code Constants". Passing kControlEntireControl indicates that either the control has no parts or the data is not tied to any specific part of the control.
inTagName
A constant representing the control-specific data you wish to set; see "Control Data Tag Constants".
inSize
The size (in bytes) of the data pointed to by the inData parameter. For variable-length control data, pass the value returned in the outMaxSize parameter of GetControlDataSize in the inSize parameter. The number of bytes must match the actual data size.
inData
On input, a pointer to a buffer allocated by your application. This buffer contains the data that you are sending to the control. After calling SetControlData, your application is responsible for disposing of this buffer, if necessary, as information is copied by control.
function result
A result code; see "Result Codes". The result code errDataNotSupported indicates that the inTagName parameter is not valid.
DISCUSSION
The SetControlData function sets control-specific data represented by the value in the inTagName parameter to the data pointed to by the inData parameter. SetControlData could be used, for example, to switch a progress indicator from a determinate to indeterminate state. For a list of the control attributes that can be set, see "Control Data Tag Constants".

SEE ALSO
GetControlData.

"Appearance Manager Gestalt Selector Constants".


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998